﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OnlineSoccerManager.Helper
{
    public static class StringExtensions
    {
        static public int ParseInt(this string str) {
            if (str.Contains("."))
                str = str.Replace(".","");

            int parsed = 0;
            int.TryParse(str, out parsed);
            return parsed;
        }

        static public decimal? ParseDecimal(this string str)
        {

            decimal parsed = 0;
            if (decimal.TryParse(str, out parsed))
                return parsed;
            else
                return null;
        }
    }
}
